flow box: Fix bad children allocation with RTL locales
authorRafal Luzynski <digitalfreak@lingonborough.com>
Fri, 4 Sep 2015 09:21:08 +0000 (11:21 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Sep 2015 13:23:52 +0000 (09:23 -0400)
If the position of the children is always relative to the box
then we should not take the allocation of the box into account
when flipping the children for RTL text direction.

This patch also removes unused assignments to child_allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=754559

gtk/gtkflowbox.c

index 8b65d65ecfc897a7571ee14d4e181136834069f3..f53e908c00bcef5103cd37169b30a8b108d376a0 100644 (file)
@@ -1606,11 +1606,6 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
   gint i, this_line_size;
   GSequenceIter *iter;
 
-  child_allocation.x = 0;
-  child_allocation.y = 0;
-  child_allocation.width = 0;
-  child_allocation.height = 0;
-
   gtk_widget_set_allocation (widget, allocation);
   window = gtk_widget_get_window (widget);
   if (window != NULL)
@@ -1618,10 +1613,6 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
                             allocation->x, allocation->y,
                             allocation->width, allocation->height);
 
-  child_allocation.x = 0;
-  child_allocation.y = 0;
-  child_allocation.width = allocation->width;
-
   min_items = MAX (1, priv->min_children_per_line);
 
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -1938,7 +1929,7 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
         }
 
       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
-        child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
+        child_allocation.x = allocation->width - child_allocation.x - child_allocation.width;
       gtk_widget_size_allocate (child, &child_allocation);
 
       item_offset += this_item_size;